#!/usr/bin/env bash
git pull
mvn install -Dmaven.test.skip=true
cd target/
cp -r zhilianApi.jar zhilianApiCopy.jar
cp -r zhilianApi-0.0.1-SNAPSHOT.jar zhilianApi.jar
PID=$(ps -ef | grep zhilianApi.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
    echo "服务已关闭"
else
    kill -9  $PID
fi
nohup java -jar zhilianApi.jar  --spring.profiles.active=prod >output 2>&1 &
tail -f output



